﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraEditors.Controls;
using Model;

namespace TanHungLong
{
    public partial class FrmAbout : RmsControl.FrmBase
    {
        #region variant
        private FrmMain main = null;
        private FormStatus formStatus = FormStatus.View;
        #endregion variant

        //=====================================
        #region form
        public FrmAbout(FrmMain main)
        {
            InitializeComponent();
            this.KeyPreview = true;

            this.lblPhienBan.Text = "Version " + Utility.strPhienBan;

            this.main = main;
            this.main.ShowBgr();
            ShowForm(this.main);

            this.FormClosing += new FormClosingEventHandler(FrmAbout_FormClosing);
            this.btnClose.Click += new EventHandler(btnClose_Click);

            this.Shown += new EventHandler(FrmAbout_Shown);
            this.KeyDown += new KeyEventHandler(FrmAbout_KeyDown);
        }

        private void FrmAbout_KeyDown(object sender, KeyEventArgs e)
        {
            if (this.btnClose.Visible && ((e.KeyCode == Keys.Q && Control.ModifierKeys == Keys.Control) || (e.KeyCode == Keys.F10)))
                this.Close();
        }

        private void FrmAbout_Shown(object sender, EventArgs e)
        {
            this.btnClose.Focus();
        }

        private void FrmAbout_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.main.Controls.Remove(this);
            this.main.HideBgr();
            this.Dispose();
        }
        #endregion form

        //=====================================
        #region control
        #endregion control

        //=====================================
        #region button

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        #endregion button

        //=====================================
        #region grid
        #endregion grid

        //=====================================
        #region function


        #endregion function
    }
}